#include <gtk/gtk.h>
#include "src/nemo-bookmark-list.h"
#include <libnemo-private/nemo-bookmark.h>
#include <libnemo-private/nemo-file.h>

int 
main (int argc, char* argv[])
{
    gtk_init (&argc, &argv);

    NemoFile *file;
    NemoBookmarkList *bookmarklist;
    NemoBookmark *bookmark, *bookmark2;
    GFile *location;

    bookmarklist = nemo_bookmark_list_get_default ();
    g_print ("list length:%d\n", nemo_bookmark_list_length (bookmarklist));

    file = nemo_file_get_by_uri ("file:///usr/share/icons");

    g_print ("\nnew bookmark\n");
    bookmark = nemo_bookmark_new (nemo_file_get_location (file), NULL, NULL, NULL);

    g_print ("bookmark name:%s\n", nemo_bookmark_get_name (bookmark));
    g_print ("bookmark uri:%s\n", nemo_bookmark_get_uri (bookmark));
    g_print ("bookmark icon name:%s\n", nemo_bookmark_get_icon_name (bookmark));

    g_print ("\nset scroll pos\n");
    nemo_bookmark_set_scroll_pos (bookmark, "file:///usr/share/icons");
    g_print ("bookmark scroll pos:%s\n", nemo_bookmark_get_scroll_pos (bookmark));

    g_print ("\nset custom name\n");
    nemo_bookmark_set_custom_name (bookmark, "my bookmark");
    g_print ("bookmark name:%s\n", nemo_bookmark_get_name (bookmark));

    g_print ("\nlist append\n");
    nemo_bookmark_list_append (bookmarklist, bookmark);
    g_print ("list length:%d\n", nemo_bookmark_list_length (bookmarklist));
    g_print ("\nbookmark contains:%d\n", nemo_bookmark_list_contains (bookmarklist, bookmark));

    g_print ("\nget list item at\n");
    bookmark2 = nemo_bookmark_list_item_at (bookmarklist, 0);
    g_print ("bookmark name:%s\n", nemo_bookmark_get_name (bookmark2));

    g_print ("\nbookmark copy\n");
    bookmark2 = nemo_bookmark_copy (bookmark);
    g_print ("copy bookmark name:%s\n", nemo_bookmark_get_name (bookmark2));

    g_print ("\ndelete list item at\n");
    nemo_bookmark_list_delete_item_at (bookmarklist, 0);
    g_print ("list length:%d\n", nemo_bookmark_list_length (bookmarklist));
    g_print ("bookmark contains:%d\n", nemo_bookmark_list_contains (bookmarklist, bookmark));

    location = nemo_bookmark_get_location (bookmark);
    g_print ("\nlocation uri:%s\n", g_file_get_uri (location));

    nemo_file_unref (file);

    return 0;
}